package org.coderjonny.feign;

import org.coderjonny.bean.Product;
import org.coderjonny.dto.Request;
import org.coderjonny.dto.Result;
import org.coderjonny.dto.product.ProductId;
import org.coderjonny.dto.product.UpdateStock;
import org.coderjonny.service.fallback.service.ProductServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "server-product",fallback = ProductServiceFallback.class)
public interface ProductService {
    @PostMapping("/product/getByProductId")
    Result<Product> getByProductId(@RequestBody Request<ProductId> request);

    @PostMapping("/product/updateStock")
    Result<String> updateStockById(@RequestBody Request<UpdateStock> request);
}
